package com.telit.communicate.constant;

import java.lang.reflect.Field;


/**
 * @author zhouyu
 * @description 消息来源dto
 */
public enum MsgSource {

    /**
     * web端
     */
    WEB,
    /**
     * 无人机端
     */
    UAV,
    /**
     * 安卓端
     */
    PHONE;

    @Override
    public String toString() {
        return this.name();
    }

    public static MsgSource getMsgSource(String source) {
        switch (source) {
            case "WEB":
                return MsgSource.WEB;
            case "UAV":
                return MsgSource.UAV;
            case "PHONE":
                return MsgSource.PHONE;
            default:
                return null;
        }
    }


    public static Field[] getFields() {
        return MsgSource.class.getFields();
    }

}
